//
//  RunFriendComment_TVC.m
//  Run
//
//  Created by BetaTheta on 16/4/6.
//  Copyright © 2016年 BetaTheta. All rights reserved.
//

#import "RunFriendComment_TVC.h"

@implementation RunFriendComment_TVC

- (void)setCommentModel:(RunFriendComment_Model *)commentModel{
    _commentModel = commentModel;
    
    if (self) {
        [_faceImg sd_setImageWithURL:[NSURL URLWithString:commentModel.avatar]];
        _nameLabel.text = commentModel.username;
        _commentLabel.text = commentModel.text;
        
    }
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self =  [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.faceImg = [[UIImageView alloc] init];
        [self.contentView addSubview:_faceImg];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nameLabel];
        
        self.commentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_commentLabel];
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _faceImg.frame = CGRectMake(5, 5, CHEIGHT - 10, CHEIGHT - 10);
    _faceImg.layer.cornerRadius = self.faceImg.frame.size.width / 2;
    _faceImg.clipsToBounds = YES;
    
    _nameLabel.frame = CGRectMake(CHEIGHT, 5, 150, (CHEIGHT - 10)/ 2);
    _commentLabel.frame = CGRectMake(CHEIGHT, CHEIGHT - 10 + 5, CWIDTH - CHEIGHT - 5, CHEIGHT - 10);
    _commentLabel.numberOfLines = 0;
    
    
 
   
    
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
